<#assign menu="order">
<#assign submenu="order_list">
<#include "../../manage/head.ftl">
<style type="text/css">
    .pagination {
        border-radius: 4px;
        display: inline-block;
        margin: 0;
        padding-left: 0;
    }
    .search{
        width: 200px;
    }

</style>
<!--main content start-->
<section id="main-content">
    <section class="wrapper">

        <!-- page start-->
        <section class="panel">
            <header class="panel-heading">
                <div class="row">
                    <div class="col-lg-4">
                        <ul class="breadcrumb" style="margin-bottom:0px;">
                            <li>
                                <a href="${BASE_PATH}/manage/order/list.htm">商品列表</a>
                            </li>
                        </ul>
                    </div>
                    <div class="col-lg-8">
                        <a class="btn btn-primary" style="float:right;"
                           href="${BASE_PATH}/manage/order/add.htm">添加商品</a>
                    </div>
                </div>
            </header>
            <div class="panel-body">
                <div class="adv-table">
                    <div role="grid" class="dataTables_wrapper" id="hidden-table-info_wrapper">
                        <table data-toggle="table" class="table table-striped table-advance table-hover" data-search="true">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>订单号</th>
                                <th>商品名</th>
                                <th>下单人名字</th>
                                <th>下单人电话</th>
                                <th>收货人名字</th>
                                <th>收货人电话</th>
                                <th>收货地址</th>
                                <th>备注</th>
                                <th>状态</th>
                                <th>操作</th>

                            </tr>
                            </thead>
                            <tbody role="alert" aria-live="polite" aria-relevant="all">
                            <#list pageVo.list as e>
                            <tr class="gradeA odd">
                                <td>${e.id}</td>
                                <td>
                                    ${e.orderId}
                                </td>
                                <td>
                                    ${e.name!}
                                </td>
                                <td>${e.orderName!} </td>
                                <td>
                                    ${e.orderPhone!}
                                </td>
                                <td>
                                    ${e.consigneeName!}
                                </td>
                                <td>
                                    ${e.consigneePhone!}
                                </td>
                                <td>
                                    ${e.consigneeAddress!}
                                </td>
                                <td>
                                    ${e.otherReq}
                                </td>
                                <td>
                                    ${e.showShippingType!}
                                </td>

                                <td>
                                    <#if e.status!=9>

                                        <a href="${BASE_PATH}/manage/order/check.htm?orderId=${e.id}" title="审核订单" class="btn btn-default blue">
                                            审核订单
                                        </a>
                                        <#else >
                                        查看
                                    </#if>
                                   
                                </td>
                            </tr>
                            </#list>
                            </tbody>
                        </table>
                        <div style="height: 30px;">
                            <div class="pagination">${pageVo.pageNumHtml} </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

    </section>
</section>



<#include "../../manage/foot.ftl">


<script>
    $(function () {
        var pageNum = "${p}";
        $('.js_order_delete').click(function () {
            var orderId = $(this).attr('orderId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/order/delete.json", {"orderId": orderId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });

        $(".js_order_check").change(function () {
            $.post("${BASE_PATH}/manage/order/check.json",
                    {"articleId": $(this).attr("orderId"), check: $(this).val()},
                    function (data) {
                        if (data.result) {
                            window.location.href = "${BASE_PATH}/manage/order/list.htm?p=" + pageNum;
                        } else {
                            bootbox.alert(data.msg,
                                    function () {
                                        window.location.href = "${BASE_PATH}/manage/order/list.htm?p=" + pageNum;
                                    });
                        }
                    }, "json");
        });
    });
</script>
